<template>
    <div>
        <van-cell title="收藏记录" is-link to="/my" arrow-direction="left" class="top"/>

        <router-link v-for="(item,index) in list" :key="index" class="collection" :to="'/NewsPage/'+item.articleId" tag="div">
            <van-row>
             <van-col span="10"> <img :src=item.bannerImgUrl alt="" ></van-col>
             <van-col span="14">
                 <h6>{{item.title}}</h6>
                 <h6 style="padding-top:8px;color: #FD7304">{{item.articleSource}}</h6>
                 <h6 style="padding-top:8px;color: #cccccc">{{item.createTime}}</h6>
             </van-col>
                </van-row>
        </router-link>
    </div>
</template>

<script>

    import {collection} from "../../../api/user-api"

    export default {
        name: "Collection",
        data(){
            return{
                title:'',
                list:[]
            }
        },
        created() {
            collection().then(res=>{
                this.list=res.rows
                this.$store.commit("favorite",
                    {favorite: 3,})
            })
        },
    }
</script>

<style scoped lang="less">
    .top{
        background: #EDEDED;
        height: 50px;
        /*line-height: 50px;*/
        font-size: 20px;
        text-align: center;

    }
    .collection{
        width: 100%;
        height: 110px;
        padding: 10px;
        img{
          width: 120px;
            height: 80px;
        }
    }

</style>